package com.cl.bootws.message;


public enum MessageType {

    /**
     * 系统消息 0000;
     * 心跳检查消息 0001;
     * 点对点消息 2001;
     */
    SYSTEM("0000"),
    PING("0001"),
    PERSON("2001");

    private String type;

    MessageType(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static MessageType getMessageType(String type) {
        for (MessageType messageType : values()) {
            if (messageType.getType().equals(type)) {
                return messageType;
            }
        }
        return null;
    }

}
